<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
   <div id="app">
       <my-header></my-header>
   </div>
   
   <div id="app2">
        <my-header></my-header>
   </div>
</body>
<script src="./base/vue.js"></script>

<script>
    //全局组件创建过程：
    //1  Vue.extend({template:""})  2. Vue.component(组件名称,组件)

    //1 创建组件
    var Hello = Vue.extend({
        template:"<p>我是局部组件！</p>"
    })

    new Vue({
        el:"#app",
        //2.局部组件
        components:{
            'my-header':Hello
        }
    });

    new Vue({
        el:"#app2"
    })
</script>
</html>